{% extends 'blog_main.html' %}
{% block css%}
#cke_id_content{
   width:**%；
}
{% endblock %}
{% block subnav %}
                <li class="nav-item" role="presentation">
                    <span class="nav-link">>>编辑</span>
                </li>
{% endblock %}
{% block body%}
<div>
    <form id="editarticleform" class="container" method="POST" action="/blog/publish/">
        {% csrf_token %}
        <input type="hidden" name="article_id" value="{{ article.article_id }}">
        <div class="mb-3 row">
            <div class="col-sm-2">
            </div>
            <div class="col-sm-8">
                <!--{{form.title}}-->
                <input type="text" class="form-control" id="title" name="title" placeholder="文章标题" value="{{ article.title }}">
            </div>
            <div class="col-sm-2">
            </div>
        </div>
        <div class="mb-3 row">
            <div class="col-sm-2">
            </div>
            <div class="col-sm-8">
                {{form.content}}
            </div>
            <div class="col-sm-2">
            </div>
        </div>
        <div class="mb-3 row">
            <div class="col-sm-2">
            </div>
            <div class="col-sm-10">
                <input type="submit" name="ok" value="Ok"><input type="button" name="cancel" id="cancel" value="Cancel">
            </div>
            <div class="col-sm-2">
            </div>
        </div>
    </form>
</div>
{% endblock %}
{% block javascript%}
$(function(){
    $("#cancel").click(function(){
        $(location).attr("href","/blog/arch/read/{{ article.article_id }}");
    });
});
{% endblock %}